export const linsesColor = {
  // 1:蓝.2:黄.3:黑.4:白.9其它
  '1': '蓝',
  '2': '黄',
  '3': '黑',
  '4': '白',
  '9': '其他',
};

export const checkFields = {
  isAudio: 0,
  isVideo: 0,
  isLocation: 0,
};

export const WxGloablMessageType = {
  WebsocketConnecting: '4001',
  WebsocketOpened: '4002',
  WebsocketClose: '4003',
  WebsocketRetry: '4004',
};

// 根据http协议判断是否为ws或wss
// const proto = document.location.protocol === 'http:' ? 'ws:' : 'wss:'
// 取地址+端口，配置80端口时port是空的，所以判断一下
// const address = document.location.port
//   ? document.location.hostname + ':' + document.location.port
//   : document.location.hostname
// 拼接请求地址
// const wsuri = proto + '//' + address + '/wxSocket'

// export const WxWebsocketUri = wsuri
export const WxWebsocketUri = 'wss://ms.wuxiakj.com/wxSocket';
// export const WxWebsocketUri = 'ws://gateway.wuxiakj.com/wxSocket'
// export const WxWebsocketUri = 'wss://video1.wuxiakj.com:8200/wxSocket'
// export const WxWebsocketUri = 'ws://61.164.97.51:8200/wxSocket'
// export const WxWebsocketUri = 'ws://192.168.1.201:7679/wxSocket'
// export const WxWebsocketUri = 'ws://192.168.1.192:8200/wxSocket'
// export const WxWebsocketUri = 'ws://0.0.0.0:8200/wxSocket'

export const WXSOCKET_SUBSCRIPTION_TAGS = {
  REALTIME_CAR_TREE: 1,
};

export const WXSOCKET_TYPES_RESPONSE = {
  AUTH_LOGIN_RESPONSE: 1001, // 登录鉴权应答: { type: 1001, serialNumber: xx, data: { index: 1, description: '鉴权成功' } }
  DEVICE_LAST_GPS_RESPONE: 1011, // 设备最后一次GPS，返回的内容跟1003设备GPS的内容是一样的
  HEART_BEAT_RESPONSE: 1002, // 通用应答: { type: 1002, serialNumber: xx }
  DEVICE_GPS_RESPONE: 1003, // 设备GPS
  SELECT_CARS_REALTIME_RESPONSE: 1000, // 通用应答: { type: 1000, serialNumber: -1, data: 10 }
  UNSELECT_CARS_REALTIME_RESPONSE: 1000, // 通用应答: { type: 1000, serialNumber: -1, data: 10 }
  SELECT_VIDEOS_RESPONSE: 1004, // 通用应答: { type: 1004, serialNumber: xx, data: { data: url, result: 1 } }
  GENERAL_RESPONSE_RESPONSE: 1000, // 通用应答: { type: 1000, serialNumber: -1, data: 10 }
  DEVICE_ONOFF: 1005, // 设备上下线
  DEVICE_ALERT_RESPONE: 1006, // 设备警报推送
};

export const WXSOCKET_TYPES_REQUEST = {
  AUTH_LOGIN_REQUEST: '1', // 登录鉴权应答: { type: 1001, serialNumber: xx, data: { index: 1, description: '鉴权成功' } }
  HEART_BEAT_REQUEST: '2', // 通用应答: { type: 1002, serialNumber: xx }
  SELECT_CARS_REALTIME_REQUEST: '3', // 通用应答: { type: 1000, serialNumber: -1, data: 10 }
  UNSELECT_CARS_REALTIME_REQUEST: '4', // 通用应答: { type: 1000, serialNumber: -1, data: 10 }
  SELECT_VIDEOS_REQUEST: '5', // 通用应答: { type: 1004, serialNumber: xx, data: { data: url, result: 1 } }
  HISTORY_VIDEOS_LIST: '7', // 获取历史视频列表
  HISTORY_VIDEO: '8', // 获取列表中的某个视频
};
